package Multithreading.Wait_and_Notify001;

/**
 * ClassName:Dest
 * Package:Multithreading.Wait_and_Notify
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/3/5-21:47
 * @Version:v1.0
 */
public class Dest {
    /*作用：控制生产者和消费者的执行*/

    //是否有面条  0：没有面条   1：有面条
    //boolean  true  false  (两个值)局限
    public static int foodFlag = 0;

    //总个数
    public static int count = 10;
    //锁对象
    public static Object lock = new Object();

    public static void main(String[] args) {
        //创建线程的对象
        Cook c = new Cook();
        Foodie f = new Foodie();

        //给线程设置名字
        c.setName("厨师");
        f.setName("吃货");

        //开启线程
        c.start();
        f.start();
    }
}
